import {
  request
} from '../http'

const api = {
  Book: '/article/getArticles',
  HotBook: '/article/getHotArticle',
  RecommendBooks: '/article/getRecommendBooks',
  Detail: '/article/getBookDetail',
  Search: '/article/getSearchBook?title=',
}



export const getBook = () => request({
  url: api.Book,
  method: 'get'
}, {
  loading: false
})
export const getHotBook = () => request({
  url: api.HotBook,
  method: 'get'
}, {
  loading: false
})
export const getRecommendBooks = () => request({
  url: api.RecommendBooks,
  method: 'get'
}, {
  loading: false
})
export const getBookDetail = (id) => request({
  url: `${api.Detail}/${id}`,
  method: 'get'
}, {
  loading: false
})
// 搜索
export const SearchBook = (title) => request({
  url: `${api.Search}${title}`,
  method: 'get'
}, {
  loading: false
})
